#include "RateLaw.h"

/*****************************************************************************/
double InvReactionModel(double w, double P, double T)
{
	
	double S0 = 0.1;		// no unit
	double m = 0.028;		// kg/mol
	double a = 5;			// 1/s
	double C_tot = 1e19;	// site/m^2
	double k = 1.38065e-23;	// J/K

	return w*C_tot*sqrt(2*PI*m*k*T)/(S0*P);
}
/*****************************************************************************/
double ReactionModel(double Xa, double P, double T)
{
	// Linear Reaction rate law based on eq (10) of {Lou2003, CES}
	double S0 = 0.1;		// no unit
	double m = 0.028;		// kg/mol
	double a = 5;			// 1/s
	double C_tot = 1e19;	// site/m^2
	double k = 1.38065e-23;	// J/K
	double Na = 6.02e23;

	if (Xa >= 1)
		Xa = 0.9999;
		
	return S0*P*Xa/(Na*2*a*sqrt(2*PI*m*k*T)*C_tot);	//mol/s ?? FIXME
}